/* -------------------------------------------------------------------------
   FLEXIA — Login holográfico (mobile-first, sin dependencias)
   Paleta: negro profundo, cyan #00f2ff, azul #0072ff, violeta #7000ff
   ------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --cyan: #00f2ff;
  --blue: #0072ff;
  --violet: #7000ff;
  --black: #030508;
  --glass: rgba(12, 28, 48, 0.42);
  --glass-strong: rgba(8, 20, 40, 0.72);
  --text: #e8f4ff;
  --text-dim: rgba(200, 230, 255, 0.55);
  --radius-chamfer: 14px;
  --transition-panel: 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  /* Entrada holográfica: 3D → 2D (no vuelve atrás) */
  --ease-entrance: cubic-bezier(0.19, 1, 0.22, 1);
  --dur-entrance: 1.45s;
  --font-sans: system-ui, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--black);
  overflow-x: hidden;
}

/* Fondo: ciudad / profundidad simulada */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  transition: filter var(--transition-panel), transform var(--transition-panel);
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, rgba(0, 114, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 90% 60% at 70% 20%, rgba(112, 0, 255, 0.18), transparent 50%),
    linear-gradient(180deg, #020308 0%, #050a14 40%, #020308 100%);
}

/* Desenfoque ambiental del escenario al escribir (el panel permanece nítido) */
body.is-typing .bg {
  filter: blur(7px) saturate(1.15);
  transform: scale(1.02);
}

.bg__grid {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(0, 242, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 242, 255, 0.25) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(600px) rotateX(72deg) scale(2.2);
  transform-origin: center bottom;
  mask-image: linear-gradient(to bottom, transparent 0%, black 35%, transparent 85%);
  pointer-events: none;
}

.bg__silhouettes {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(140vw, 1600px);
  height: 42vh;
  opacity: 0.35;
  filter: blur(1px);
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 40, 90, 0.5) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(0, 114, 255, 0.15) 0 2px,
      transparent 2px 48px
    );
  clip-path: polygon(0 100%, 0 35%, 8% 20%, 15% 45%, 22% 12%, 28% 38%, 35% 8%, 42% 42%, 50% 5%, 58% 40%, 65% 15%, 72% 48%, 80% 22%, 88% 52%, 95% 28%, 100% 55%, 100% 100%);
  pointer-events: none;
}

#particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.35;
  animation: float-particle linear infinite;
  box-shadow: 0 0 6px var(--cyan);
}

@keyframes float-particle {
  0% {
    transform: translateY(110vh) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.45;
  }
  90% {
    opacity: 0.35;
  }
  100% {
    transform: translateY(-10vh) translateX(20px);
    opacity: 0;
  }
}

/* Escenario 3D */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.scene {
  perspective-origin: 50% 45%;
}

.scene.scene--entrance {
  perspective: 620px;
  animation: scene-entrance-depth var(--dur-entrance) var(--ease-entrance) forwards;
}

.scene.scene--settled-2d {
  perspective: 2600px;
  perspective-origin: 50% 48%;
}

@keyframes scene-entrance-depth {
  0% {
    perspective: 620px;
    perspective-origin: 50% 36%;
  }
  100% {
    perspective: 2600px;
    perspective-origin: 50% 48%;
  }
}

/* Panel holográfico */
.panel {
  position: relative;
  width: min(92vw, 380px);
  padding: 1.35rem 1.35rem 1.15rem;
  transform-style: preserve-3d;
  will-change: transform, filter, box-shadow;
  border-radius: var(--radius-chamfer);
  clip-path: polygon(
    var(--radius-chamfer) 0%,
    calc(100% - var(--radius-chamfer)) 0%,
    100% var(--radius-chamfer),
    100% calc(100% - var(--radius-chamfer)),
    calc(100% - var(--radius-chamfer)) 100%,
    var(--radius-chamfer) 100%,
    0% calc(100% - var(--radius-chamfer)),
    0% var(--radius-chamfer)
  );
  background: linear-gradient(
    145deg,
    rgba(0, 242, 255, 0.08) 0%,
    var(--glass) 35%,
    rgba(112, 0, 255, 0.06) 100%
  );
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(0, 242, 255, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 114, 255, 0.25) inset,
    0 0 40px rgba(0, 242, 255, 0.12),
    0 24px 80px rgba(0, 0, 0, 0.65);
}

/* Entrada: parte inclinada / lejana y aterriza en frontal; luego solo respira en 2D */
.panel.panel--animating-entrance {
  animation:
    panel-entrance-holo var(--dur-entrance) var(--ease-entrance) forwards,
    panel-breathe 5.5s ease-in-out var(--dur-entrance) infinite;
}

@keyframes panel-entrance-holo {
  0% {
    opacity: 0;
    transform: rotateX(26deg) rotateY(-22deg) scale(0.82) translateY(56px) translateZ(-90px);
    filter: brightness(0.68) saturate(0.82);
    box-shadow:
      0 0 0 1px rgba(0, 114, 255, 0.12) inset,
      0 0 18px rgba(0, 242, 255, 0.04),
      0 40px 100px rgba(0, 0, 0, 0.85);
    border-color: rgba(0, 242, 255, 0.22);
  }
  28% {
    opacity: 1;
  }
  48% {
    transform: rotateX(-5deg) rotateY(5deg) scale(1.06) translateY(-12px) translateZ(36px);
    filter: brightness(1.12) saturate(1.2);
    box-shadow:
      0 0 0 1px rgba(0, 242, 255, 0.55) inset,
      0 0 72px rgba(0, 242, 255, 0.35),
      0 28px 90px rgba(0, 0, 0, 0.45);
    border-color: rgba(0, 242, 255, 0.55);
  }
  68% {
    transform: rotateX(3deg) rotateY(-3deg) scale(0.99) translateY(6px) translateZ(12px);
    filter: brightness(0.98) saturate(1.05);
  }
  100% {
    transform: rotateX(0deg) rotateY(0deg) scale(1.02) translateY(0) translateZ(24px);
    filter: brightness(1) saturate(1);
    box-shadow:
      0 0 0 1px rgba(0, 242, 255, 0.45) inset,
      0 0 60px rgba(0, 242, 255, 0.28),
      0 32px 100px rgba(0, 0, 0, 0.55);
    border-color: rgba(0, 242, 255, 0.38);
  }
}

.panel.panel--animating-entrance::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    118deg,
    transparent 0%,
    transparent 38%,
    rgba(0, 242, 255, 0.14) 48%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(112, 0, 255, 0.12) 52%,
    transparent 62%,
    transparent 100%
  );
  background-size: 240% 240%;
  background-position: 100% 40%;
  animation: panel-holo-scan var(--dur-entrance) var(--ease-entrance) forwards;
  mix-blend-mode: screen;
  opacity: 0.85;
}

@keyframes panel-holo-scan {
  0% {
    background-position: 120% 80%;
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    background-position: -20% -20%;
    opacity: 0;
  }
}

.panel.panel--settled-2d {
  transform: rotateX(0deg) rotateY(0deg) scale(1.02) translateZ(24px);
  animation: panel-breathe 5.5s ease-in-out infinite;
  box-shadow:
    0 0 0 1px rgba(0, 242, 255, 0.45) inset,
    0 0 60px rgba(0, 242, 255, 0.28),
    0 32px 100px rgba(0, 0, 0, 0.55);
  border-color: rgba(0, 242, 255, 0.38);
  will-change: auto;
}

.panel.panel--settled-2d::after {
  content: none;
}

@keyframes panel-breathe {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(0, 114, 255, 0.25) inset,
      0 0 36px rgba(0, 242, 255, 0.1),
      0 24px 80px rgba(0, 0, 0, 0.65);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(0, 114, 255, 0.35) inset,
      0 0 52px rgba(0, 242, 255, 0.22),
      0 28px 90px rgba(0, 0, 0, 0.7);
  }
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 11px,
      rgba(0, 242, 255, 0.03) 11px,
      rgba(0, 242, 255, 0.03) 12px
    ),
    radial-gradient(ellipse at 30% 20%, rgba(112, 0, 255, 0.15), transparent 55%);
  pointer-events: none;
  opacity: 0.75;
}

/* Cabecera meta */
.panel__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.sys-tag {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.sys-bar {
  margin-top: 0.35rem;
  width: 72px;
  height: 3px;
  border-radius: 2px;
  background: rgba(0, 242, 255, 0.15);
  overflow: hidden;
}

.sys-bar__fill {
  height: 100%;
  width: 62%;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  animation: sys-pulse 2.8s ease-in-out infinite;
}

@keyframes sys-pulse {
  0%,
  100% {
    opacity: 0.85;
    transform: translateX(0);
  }
  50% {
    opacity: 1;
    transform: translateX(18%);
  }
}

.clock-block {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.clock-time {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0, 242, 255, 0.45);
}

.clock-date {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-top: 0.15rem;
  text-transform: uppercase;
}

.globe-icon {
  display: inline-flex;
  margin-top: 0.35rem;
  opacity: 0.65;
}

.globe-icon svg {
  width: 22px;
  height: 22px;
}

/* Branding */
.brand {
  text-align: center;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.brand__logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.5rem;
  background: linear-gradient(135deg, var(--violet), var(--blue), var(--cyan));
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  box-shadow: 0 0 24px rgba(112, 0, 255, 0.45);
}

.brand__name {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.42em;
  margin: 0;
  padding-left: 0.35em;
  text-transform: uppercase;
}

.brand__welcome {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.35em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Formulario */
.login-form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field__label {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--glass-strong);
  border: 1px solid rgba(0, 242, 255, 0.28);
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s ease;
}

.input-shell:focus-within {
  border-color: rgba(0, 242, 255, 0.85);
  box-shadow:
    0 0 0 1px rgba(0, 242, 255, 0.35),
    0 0 22px rgba(0, 242, 255, 0.18);
}

.input-shell svg {
  flex-shrink: 0;
  opacity: 0.55;
}

.input-shell input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.92rem;
}

.input-shell input::placeholder {
  color: rgba(160, 200, 230, 0.45);
}

.toggle-pass {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.toggle-pass:hover,
.toggle-pass:focus-visible {
  background: rgba(0, 242, 255, 0.12);
  box-shadow: 0 0 14px rgba(0, 242, 255, 0.25);
  outline: none;
}

/* Alternar identificador: teléfono (default) ↔ correo */
.toggle-identity {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.toggle-identity:hover,
.toggle-identity:focus-visible {
  background: rgba(0, 242, 255, 0.12);
  box-shadow: 0 0 14px rgba(0, 242, 255, 0.25);
  outline: none;
}

.toggle-identity__icon {
  grid-area: 1 / 1;
  display: none;
  opacity: 0.65;
  pointer-events: none;
}

.toggle-identity__icon.is-visible {
  display: block;
}

.toggle-identity__icon svg {
  display: block;
}

.link-muted {
  align-self: flex-end;
  margin-top: -0.15rem;
  font-size: 0.72rem;
  color: rgba(0, 174, 255, 0.85);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.link-muted:hover,
.link-muted:focus-visible {
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0, 242, 255, 0.45);
  outline: none;
}

/* Botón principal */
.btn-primary {
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(95deg, var(--violet), var(--blue) 45%, var(--cyan));
  background-size: 140% 100%;
  background-position: 0% 50%;
  box-shadow:
    0 0 24px rgba(112, 0, 255, 0.35),
    0 8px 28px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    background-position 0.45s ease,
    filter 0.35s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-3px);
  box-shadow:
    0 0 36px rgba(0, 242, 255, 0.45),
    0 12px 36px rgba(0, 0, 0, 0.5);
  background-position: 100% 50%;
  outline: none;
  filter: brightness(1.08);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-primary[disabled],
.btn-primary[aria-busy="true"] {
  opacity: 0.65;
  cursor: progress;
  filter: saturate(0.7);
}

/* Biometría: oculto por CSS hasta que JS añada .biometric-section--available tras verificar */
.biometric-section {
  display: none !important;
  flex-direction: column;
  gap: 0.15rem;
}

.biometric-section.biometric-section--available {
  display: flex !important;
}

.bio-feedback {
  margin: 0.35rem 0 0;
  min-height: 1em;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  line-height: 1.35;
  color: rgba(255, 190, 140, 0.92);
  text-align: center;
}

.bio-feedback.bio-feedback--ok {
  color: rgba(0, 242, 255, 0.88);
}

.bio-feedback:empty {
  display: none;
}

/* Mensaje persistente del formulario (login OK / errores) */
.form-feedback {
  margin: 0.35rem 0 0;
  min-height: 1em;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  line-height: 1.45;
  text-align: center;
  color: rgba(255, 170, 130, 0.95);
}

.form-feedback.is-ok {
  color: rgba(0, 242, 255, 0.92);
}

.form-feedback:empty {
  display: none;
}

/* Separador OR */

.or-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.15rem 0;
  color: var(--text-dim);
  font-size: 0.62rem;
  letter-spacing: 0.35em;
}

.or-row::before,
.or-row::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 255, 0.35), transparent);
}

/* Biometría */
.btn-bio {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 242, 255, 0.45);
  background: rgba(4, 14, 28, 0.65);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.btn-bio:hover,
.btn-bio:focus-visible {
  transform: translateY(-2px);
  border-color: var(--cyan);
  box-shadow: 0 0 28px rgba(0, 242, 255, 0.22);
  outline: none;
}

.btn-bio[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.btn-bio__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(0, 242, 255, 0.08);
  animation: fingerprint-pulse 2.2s ease-in-out infinite;
}

@keyframes fingerprint-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 242, 255, 0.35);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(0, 242, 255, 0);
  }
}

.btn-bio__title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.btn-bio__sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 400;
  text-transform: none;
}

.signup {
  margin-top: 0.65rem;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.signup[hidden] {
  display: none;
}

.signup a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 600;
  transition: text-shadow 0.25s ease;
}

.signup a:hover,
.signup a:focus-visible {
  text-shadow: 0 0 14px rgba(0, 242, 255, 0.55);
  outline: none;
}

/* Footer seguridad */
.panel__secure {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(0, 242, 255, 0.15);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.secure-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.secure-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  50% {
    opacity: 0.65;
  }
}

.secure-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(0, 242, 255, 0.65);
}

/* Tablets / desktop: panel un poco más ancho */
@media (min-width: 480px) {
  .panel {
    width: min(90vw, 420px);
    padding: 1.55rem 1.65rem 1.35rem;
  }

  .brand__name {
    font-size: 1.85rem;
  }
}

/* ---------- Wizard crear cuenta ---------- */
body.signup-wizard-open {
  overflow: hidden;
}

body.signup-wizard-open .stage {
  visibility: hidden;
  pointer-events: none;
}

.signup-wizard {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.signup-wizard.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.signup-wizard__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 14, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.signup-wizard__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: min(92dvh, 780px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-chamfer);
  background: linear-gradient(
    160deg,
    rgba(0, 242, 255, 0.06) 0%,
    var(--glass) 40%,
    rgba(112, 0, 255, 0.06) 100%
  );
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(0, 242, 255, 0.38);
  box-shadow:
    0 0 48px rgba(0, 242, 255, 0.14),
    0 24px 64px rgba(0, 0, 0, 0.65);
}

.signup-wizard__scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.15rem 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.signup-wizard__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.signup-wizard__head-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.signup-wizard__head-copy {
  min-width: 0;
}

.wizard-head-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(0, 242, 255, 0.45);
  box-shadow: 0 0 14px rgba(0, 242, 255, 0.18);
  background: rgba(0, 20, 40, 0.75);
  display: none;
}

.wizard-head-avatar.is-visible {
  display: block;
}

.wizard-head-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: middle;
}

.signup-wizard__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.signup-wizard__subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.btn-wizard-back {
  flex-shrink: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(0, 242, 255, 0.35);
  border-radius: 8px;
  background: rgba(4, 14, 28, 0.55);
  color: var(--cyan);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.btn-wizard-back:hover,
.btn-wizard-back:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 242, 255, 0.2);
  outline: none;
}

.wizard-progress {
  display: flex;
  gap: 5px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.wizard-progress__dot {
  flex: 1;
  min-width: 18px;
  height: 3px;
  border-radius: 2px;
  background: rgba(0, 242, 255, 0.15);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.wizard-progress__dot.is-done {
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  box-shadow: 0 0 10px rgba(0, 242, 255, 0.35);
}

.wizard-step {
  display: none;
  animation: wizard-fade 0.35s ease;
}

.wizard-step.is-active {
  display: block;
}

@keyframes wizard-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wizard-step__lead {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(220, 235, 255, 0.78);
  letter-spacing: 0.04em;
}

.wizard-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1rem;
}

.wizard-actions--row {
  flex-direction: row;
  flex-wrap: wrap;
}

.wizard-actions--row .btn-secondary-wizard {
  flex: 1;
  min-width: 120px;
}

.wizard-actions--nav {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
}

.wizard-actions--nav > .btn-secondary-wizard,
.wizard-actions--nav > .btn-primary {
  flex: 1;
  min-width: 0;
}

.wizard-actions--nav-triple {
  flex-wrap: wrap;
}

.wizard-actions--nav-triple > .btn-secondary-wizard,
.wizard-actions--nav-triple > .btn-primary {
  flex: 1;
  min-width: min(100%, 108px);
}

.btn-secondary-wizard {
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 242, 255, 0.42);
  background: rgba(6, 18, 38, 0.65);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.btn-secondary-wizard:hover:not(:disabled),
.btn-secondary-wizard:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--cyan);
  box-shadow: 0 0 22px rgba(0, 242, 255, 0.18);
  outline: none;
}

.btn-secondary-wizard:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-text-wizard {
  padding: 0.5rem;
  border: none;
  background: transparent;
  color: rgba(0, 200, 255, 0.88);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-text-wizard:hover,
.btn-text-wizard:focus-visible {
  color: var(--cyan);
  outline: none;
}

/* Recorte foto */
.wizard-crop-wrap {
  margin-bottom: 0.75rem;
}

.wizard-crop-viewport {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(0, 242, 255, 0.45);
  box-shadow:
    inset 0 0 0 1px rgba(0, 114, 255, 0.35),
    0 0 28px rgba(0, 242, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.wizard-crop-viewport.is-dragging {
  cursor: grabbing;
}

.wizard-crop-viewport img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.wizard-crop-frame {
  position: absolute;
  inset: 10%;
  border: 2px dashed rgba(0, 242, 255, 0.75);
  border-radius: 8px;
  pointer-events: none;
  box-shadow: 0 0 20px rgba(0, 242, 255, 0.15);
}

.wizard-crop-zoom {
  margin-top: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.wizard-crop-zoom input[type="range"] {
  flex: 1;
  accent-color: var(--cyan);
}

.wizard-crop-hint {
  margin: 0.45rem 0 0;
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-align: center;
}

.wizard-photo-preview-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 1rem;
}

.wizard-photo-preview {
  width: 96px;
  height: 96px;
  margin-inline: auto;
  border-radius: 50%;
  border: 2px solid rgba(0, 242, 255, 0.35);
  overflow: hidden;
  background: rgba(0, 20, 40, 0.6);
  flex-shrink: 0;
}

.wizard-photo-preview.has-img {
  border-color: rgba(0, 242, 255, 0.5);
  box-shadow: 0 0 14px rgba(0, 242, 255, 0.15);
}

.wizard-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wizard-photo-preview img[hidden] {
  display: none !important;
}

.wizard-avatar-preview {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.65rem;
  border-radius: 50%;
  border: 2px solid rgba(0, 242, 255, 0.4);
  overflow: hidden;
  background: rgba(0, 20, 40, 0.6);
  display: none;
}

.wizard-avatar-preview.has-img {
  display: block;
}

.wizard-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fortaleza contraseña */
.password-meter {
  margin-top: 0.4rem;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 40, 80, 0.5);
  overflow: hidden;
}

.password-meter__fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition:
    width 0.35s ease,
    background 0.35s ease;
}

.password-meter__fill.level-0 {
  width: 15%;
  background: rgba(255, 80, 80, 0.85);
}

.password-meter__fill.level-1 {
  width: 40%;
  background: rgba(255, 170, 60, 0.9);
}

.password-meter__fill.level-2 {
  width: 70%;
  background: rgba(0, 200, 255, 0.85);
}

.password-meter__fill.level-3 {
  width: 100%;
  background: linear-gradient(90deg, var(--cyan), #40ffb0);
}

.password-strength-label {
  margin-top: 0.35rem;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.password-strength-label.level-0 {
  color: rgba(255, 140, 120, 0.95);
}

.password-strength-label.level-3 {
  color: rgba(100, 255, 210, 0.9);
}

.wizard-field-hint {
  margin-top: 0.25rem;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: rgba(255, 180, 140, 0.88);
  min-height: 1.2em;
}

.wizard-field-hint.is-ok {
  color: rgba(120, 255, 200, 0.75);
}

.wizard-phone-region {
  margin: 0.35rem 0 0;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: rgba(120, 220, 255, 0.82);
  min-height: 1.15em;
}

.wizard-phone-region.is-partial {
  color: rgba(200, 230, 255, 0.45);
}

.wizard-privacy-link-wrap {
  margin: 0 0 0.75rem;
  text-align: center;
}

.wizard-bio-feedback {
  margin-top: 0.45rem;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  line-height: 1.35;
  color: rgba(255, 190, 140, 0.92);
  text-align: center;
  min-height: 1em;
}

.wizard-bio-feedback.is-ok {
  color: rgba(0, 242, 255, 0.88);
}

/* Modal aviso de privacidad */
.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.privacy-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.privacy-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 14, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.privacy-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(85dvh, 560px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-chamfer);
  background: linear-gradient(
    165deg,
    rgba(0, 242, 255, 0.07) 0%,
    var(--glass-strong) 45%,
    rgba(112, 0, 255, 0.06) 100%
  );
  border: 1px solid rgba(0, 242, 255, 0.38);
  box-shadow: 0 0 40px rgba(0, 242, 255, 0.12), 0 20px 48px rgba(0, 0, 0, 0.55);
}

.privacy-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem 0.5rem;
  border-bottom: 1px solid rgba(0, 242, 255, 0.15);
}

.privacy-modal__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
}

.privacy-modal__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: rgba(0, 40, 80, 0.5);
  color: var(--cyan);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.privacy-modal__close:hover,
.privacy-modal__close:focus-visible {
  background: rgba(0, 242, 255, 0.15);
  outline: none;
}

.privacy-modal__body {
  padding: 0.85rem 1rem 1rem;
  overflow-y: auto;
  font-size: 0.72rem;
  line-height: 1.55;
  letter-spacing: 0.04em;
  color: rgba(210, 230, 255, 0.88);
}

.privacy-modal__body p {
  margin: 0 0 0.65rem;
}

.privacy-modal__body p:last-child {
  margin-bottom: 0;
}

.privacy-modal__foot {
  padding: 0.65rem 1rem 1rem;
  border-top: 1px solid rgba(0, 242, 255, 0.12);
}

.privacy-modal__foot .btn-primary {
  width: 100%;
  justify-content: center;
}

.device-blocked-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.device-blocked-modal__label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(184, 196, 212, 0.85);
  margin: 0.65rem 0 0.35rem;
}
.device-blocked-modal__select {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(0, 242, 255, 0.22);
  background: rgba(0, 0, 0, 0.35);
  color: #e8f4ff;
  font-size: 0.82rem;
  padding: 0.35rem 0.55rem;
}
.device-blocked-modal__contact-detail {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  min-height: 1.2em;
}
.device-blocked-modal__actions .btn-primary,
.device-blocked-modal__actions .btn-secondary {
  width: 100%;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}
.device-blocked-modal__wa {
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.45);
  color: #b8ffd3;
}
.btn-secondary {
  border: 1px solid rgba(0, 242, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text, #e8f4ff);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.privacy-login-wrap {
  margin: 0.5rem 0 0;
  text-align: center;
}

.privacy-login-wrap .btn-text-wizard {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
}

@media (max-width: 420px) {
  .signup-wizard__panel {
    border-radius: 12px;
  }

  .wizard-actions--row:not(.wizard-actions--nav) {
    flex-direction: column;
  }

  .wizard-actions--row .btn-secondary-wizard {
    min-width: 0;
  }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .panel.panel--animating-entrance {
    animation: none !important;
  }

  .panel.panel--animating-entrance::after {
    animation: none !important;
    opacity: 0 !important;
  }

  .scene.scene--entrance {
    animation: none !important;
  }

  .panel.panel--settled-2d {
    transform: rotateX(0deg) rotateY(0deg) scale(1) translateZ(0) !important;
    animation: none !important;
  }

  body.is-typing .bg {
    filter: none;
    transform: none;
  }

  .wizard-step {
    animation: none;
  }
}

/* Contraste focus visible genérico para enlaces */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.btn-primary:focus-visible {
  outline-offset: 4px;
}
